﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using BUS;

namespace GaSaiGon.GUI
{
    public partial class frmChiTietChuyenTau : Form
    {
        private int _IDChuyenTau;

        public int IDChuyenTau
        {
            get { return _IDChuyenTau; }
            set { _IDChuyenTau = value; }
        }
        private string _MaChuyenTau;

        public string MaChuyenTau
        {
            get { return _MaChuyenTau; }
            set { _MaChuyenTau = value; }
        }
        private int _LoaiChuyen;

        public int LoaiChuyen
        {
            get { return _LoaiChuyen; }
            set { _LoaiChuyen = value; }
        }
        private DateTime _NgayKhoiHanh;

        public DateTime NgayKhoiHanh
        {
            get { return _NgayKhoiHanh; }
            set { _NgayKhoiHanh = value; }
        }
        private string _MaTau;

        public string MaTau
        {
            get { return _MaTau; }
            set { _MaTau = value; }
        }
        private int _ThongTinGa;

        public int ThongTinGa
        {
            get { return _ThongTinGa; }
            set { _ThongTinGa = value; }
        }

        private int _ThoiGian;

        public int ThoiGian
        {
            get { return _ThoiGian; }
            set { _ThoiGian = value; }
        }

        public frmChiTietChuyenTau()
        {
            InitializeComponent();
        }

        private void frmChiTietChuyenTau_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            ChuyenTauDTO _ChuyenTauDto = new ChuyenTauDTO();
            ChuyenTauBUS _ChuyenTauBus = new ChuyenTauBUS();
            _ChuyenTauDto.LoaiChuyen = LoaiChuyen;
            _ChuyenTauDto.ThongTinGa = ThongTinGa;

            lbIDChuyenTau.Text = IDChuyenTau.ToString();
            lbMaChuyenTau.Text = MaChuyenTau.ToString();
            dt = _ChuyenTauBus.LayLoaiChuyen(_ChuyenTauDto);
            lbLoaiChuyen.Text = dt.Rows[0]["TenLoaiChuyen"].ToString();
            lbNgayKhoiHanh.Text = NgayKhoiHanh.ToString();
            lbMaTau.Text = MaTau.ToString();
            dt = _ChuyenTauBus.DiaDiemDi(_ChuyenTauDto);
            lbDiaDiemDi.Text = dt.Rows[0]["TenDiaDiem"].ToString();
            lbThoiGian.Text = ThoiGian.ToString() + " phút";            
            dt = _ChuyenTauBus.DiaDiemDen(_ChuyenTauDto);
            lbDiaDiemDen.Text = dt.Rows[0]["TenDiaDiem"].ToString();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
